package com.aspose.cells;

class zamk {
   static Object a(Object var0, Object var1, boolean var2) {
      if (com.aspose.cells.a.c.zc.a(var1)) {
         Object[] var3 = (Object[])((Object[])var1);
         Object var4 = com.aspose.cells.b.a.za.a((Object[])var3, 0);
         boolean var5 = com.aspose.cells.a.c.zc.a(var4);
         Object var8;
         if (var5) {
            Object[] var6 = (Object[])((Object[])var4);
            if (var6.length > var3.length) {
               for(int var13 = var6.length - 1; var13 >= 0; --var13) {
                  var8 = com.aspose.cells.b.a.za.a(var6, var13);
                  Object var14 = zmc.a(var0, var8, var2, true);
                  if (!(var14 instanceof zst)) {
                     double var10 = (Double)var14;
                     if (var10 >= 0.0D) {
                        return com.aspose.cells.b.a.za.a((Object[])((Object[])com.aspose.cells.b.a.za.a(var3, var3.length - 1)), var13);
                     }
                  }
               }

               return zst.c;
            }
         }

         for(int var12 = var3.length - 1; var12 >= 0; --var12) {
            var4 = com.aspose.cells.b.a.za.a(var3, var12);
            Object[] var7 = (Object[])((Object[])var4);
            if (var5) {
               var4 = com.aspose.cells.b.a.za.a((Object[])var7, 0);
            }

            var8 = zmc.a(var0, var4, var2, true);
            if (var8 instanceof zst) {
               return var8;
            }

            double var9 = (Double)var8;
            if (var9 >= 0.0D) {
               if (!var5) {
                  return var4;
               }

               return com.aspose.cells.b.a.za.a(var7, var7.length - 1);
            }
         }
      }

      return zst.c;
   }
}
